***Upload Data



//Descriptives (Table 3, Appendix)
sum  tot_rate econAid1 govAid1 otherAid1 cum_EconAid cum_GovAid  cum_OtherAid FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  Checks1 ExecConstraints1 PoliticalTerror1 JudicialInd1 FreeMovement1 Corruption1 OECD_TerrorDeaths1 logOECDGDP TerrorCount1 MigrationPolicy1 UNpolicy1 emigrationbydecade gdp1sq


///Main models (table 2)

xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, replace ctitle(Model 1)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1 OilRents1  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 2)
xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 gdp1 gdp1sq PopDensity1 polity1 intensity1  OilRents1  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 3)
xtmixed tot_rate econAid1 govAid1 otherAid1 FDI1  Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  i.Year || country1:
outreg2 using myreg.doc, append ctitle(Model 4)
xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  OECD_TerrorDeaths1 logOECDGDP  i.Year, fe robust
outreg2 using myreg.doc, append ctitle(Model 5)

//with another push factor variable: terrorist deaths in sample country (Table 6, Appendix):
xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  OECD_TerrorDeaths1 logOECDGDP TerrorCount1 i.Year, fe robust
outreg2 using myreg.doc, replace ctitle(Model 6)


//Robustness and endogeneity tests:

** Timeline models (Table 6, Appendix):
xtreg tot_rate econAid2 govAid2 otherAid2 FDI2 Trade2 gdp2 PopDensity2 polity2 intensity2  OilRents2  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, replace ctitle(Model 7)
xtreg tot_rate econAid3 govAid3 otherAid3 FDI3 Trade3 gdp3 PopDensity3 polity3 intensity3  OilRents3  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 8)
xtreg tot_rate econAid4 govAid4 otherAid4 FDI4 Trade4 gdp4 PopDensity4 polity4 intensity4  OilRents4  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 9)
xtreg tot_rate cum_EconAid cum_GovAid  cum_OtherAid FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1 OilRents1  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 10)

** Controls for political institutions (Table 7, Appendix)

xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  Checks1  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, replace ctitle(Model 11)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1   ExecConstraints1  i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 12)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  PoliticalTerror1 i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 13)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  JudicialInd1 i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 14)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1 FreeMovement1 i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 15)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  Checks1 ExecConstraints1 PoliticalTerror1 JudicialInd1 FreeMovement1 Corruption1 i.Year, fe robust cluster(country1)
outreg2 using myreg.doc, append ctitle(Model 16)

** Alternative measures of border security, from Bormeo & Leblang (Table 8, Appendix):
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  MigrationPolicy1 logOECDGDP  i.Year, fe robust
outreg2 using myreg.doc, replace ctitle(Model 17)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  UNpolicy1 logOECDGDP  i.Year, fe robust
outreg2 using myreg.doc, append ctitle(Model 18)

**Model with alternative measure of emigration (Table 9, Appendix):
xtreg emigrationbydecade_inM econAid1 govAid1 otherAid1 FDI1 Trade1   i.Year , fe robust cluster(country1)
outreg2 using myreg.doc, replace ctitle(Model 19)



*** Instrumental approach using moments of IV (Table 10, Appendix):

xtivreg  tot_rate econAid1  otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  i.Year  (govAid1 = InstrumentGovAid), fe vce(robust)
outreg2 using myreg.doc, replace ctitle(Model 20)
xtivreg  tot_rate econAid1  otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  i.Year  (govAid1 = ThirdMInstrumentGovAid), fe vce(robust)
outreg2 using myreg.doc, append ctitle(Model 21)


//Additional models not in paper:

///Models with population, instead of pop density:


xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 pop1 polity1 intensity1 OilRents1  i.Year, fe robust cluster(country1)
xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 gdp1 gdp1sq pop1 polity1 intensity1  OilRents1  i.Year, fe robust cluster(country1)
xtmixed tot_rate econAid1 govAid1 otherAid1 FDI1  Trade1 gdp1 pop1 polity1 intensity1  OilRents1  i.Year || country1:
xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 gdp1 pop1 polity1 intensity1  OilRents1  OECD_TerrorDeaths1 logOECDGDP  i.Year, fe robust


** More lags - gov't aid significant at 5 and 8 yr lags - other aid not significant at any lag


xtreg tot_rate econAid5 govAid5 otherAid5 FDI5 Trade5 gdp5 PopDensity5 polity5 intensity5  OilRents5  i.Year, fe robust cluster(country1)
xtreg tot_rate econAid6 govAid6 otherAid6 FDI6 Trade6 gdp6 PopDensity6 polity6 intensity6  OilRents6  i.Year, fe robust cluster(country1)
xtreg tot_rate econAid7 govAid7 otherAid7 FDI7 Trade7 gdp7 PopDensity7 polity7 intensity7  OilRents7  i.Year, fe robust cluster(country1)
xtreg tot_rate econAid8 govAid8 otherAid8 FDI8 Trade8 gdp8 PopDensity8 polity8 intensity8  OilRents8  i.Year, fe robust cluster(country1)
xtreg tot_rate econAid9 govAid9 otherAid9 FDI9 Trade9 gdp9 PopDensity9 polity9 intensity9  OilRents9  i.Year, fe robust cluster(country1)
xtreg tot_rate econAid10 govAid10 otherAid10 FDI10 Trade10 gdp10 PopDensity10 polity10 intensity10  OilRents10  i.Year, fe robust cluster(country1)

**Models without Robust SEs

xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 i.Year, fe  cluster(country1)
xtreg tot_rate econAid1 govAid1 otherAid1 FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1 OilRents1  i.Year, fe  cluster(country1)
xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 gdp1 gdp1sq PopDensity1 polity1 intensity1  OilRents1  i.Year, fe  cluster(country1)
xtmixed tot_rate econAid1 govAid1 otherAid1 FDI1  Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  i.Year || country1:
xtreg tot_rate econAid1 govAid1 otherAid1  FDI1 Trade1 gdp1 PopDensity1 polity1 intensity1  OilRents1  OECD_TerrorDeaths1 logOECDGDP  i.Year, fe 






